﻿#ifndef ADDRESSBOOKDELEGATE_H
#define ADDRESSBOOKDELEGATE_H
#include <QAbstractItemDelegate>
class QListView;

class AddressBookDelegate : public QAbstractItemDelegate
{
    Q_OBJECT
public:
    AddressBookDelegate(QListView* pView, QObject* parent = nullptr);

    // painting
    virtual void paint(QPainter *painter,
                       const QStyleOptionViewItem &option,
                       const QModelIndex &index) const;

    virtual QSize sizeHint(const QStyleOptionViewItem &option,
                           const QModelIndex &index) const;

    virtual bool editorEvent(QEvent *event,
                             QAbstractItemModel *model,
                             const QStyleOptionViewItem &option,
                             const QModelIndex &index);

private:

private:
    QListView*          m_pView     = nullptr;

};

#endif // ADDRESSBOOKDELEGATE_H
